package com.merryituxz.o2o.service.impl;

import com.merryituxz.o2o.entity.ProductSellDaily;
import com.merryituxz.o2o.mapper.ProductSellDailyMapper;
import com.merryituxz.o2o.service.ProductSellDailyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ProductSellDailyServiceImpl implements ProductSellDailyService {
    private static Logger logger = LoggerFactory.getLogger(ProductSellDailyServiceImpl.class);

    @Autowired
    private ProductSellDailyMapper productSellDailyMapper;

    @Override
    public void dailyCalculate() {
        logger.info("Quartz Running...");
        productSellDailyMapper.insertProductSellDaily();
    }

    @Override
    public List<ProductSellDaily> listProductSellDaily(ProductSellDaily productSellDailyCondition, Date beginTime, Date endTime) {
        return productSellDailyMapper.queryProductSellDailyList(productSellDailyCondition, beginTime, endTime);
    }
}
